package cn.xiyun.xiyuncc.feignClient;

import cn.xiyun.xiyuncc.mediaFallback.MediaFallbackFactory;
import cn.xiyun.xiyuncc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-media",fallbackFactory = MediaFallbackFactory.class)
public interface MediaFeignClient {
    /**
     * 根据课程id查询视频资源
     * @param id
     * @return
     */
    @RequestMapping(value = "/mediaFile/chapterMediaFile/{id}",method = RequestMethod.GET)
    JSONResult chapterMediaFile(@PathVariable("id") Long id);

    /**
     * 根据视频id获取视频资源
     * @param id
     * @return
     */
    @RequestMapping(value = "/mediaFile/{id}",method = RequestMethod.GET)
     JSONResult get(@PathVariable("id")Long id);
}
